<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>方案详情pricePlanDetail</title>
	</head>
	<link rel="stylesheet" href="../css/common.css" />
	<style>
		body{
			background:white;
			padding-bottom:20px;
		}
		.title{
			height:45px;
			line-height:45px;
			margin-left:4px;
			font-size:14px;
			font-weight:900;
		}
		.quare{
			margin:0 7px 0 11px;
			position:relative;
			top:3px;
			display:inline-block;
			width:4px;
			height:16px;
			background:#00aa98;
		}
		table{
			border-collapse:collapse;
			margin-left:15px;
		}
		.tableSame,.tableDiff{
			width:800px;
		}
		.tableSame td{
			width:12.5%;
			height:44px;
			border:1px solid #e6e6e6;
			text-align:center;
		}
		.tableSame .exten{
			width:295px;
		}
		.tdColor{
			background:#f1f1f1;
		}
		
		.tableDiff td{
			width:33%;
			height:35px;
			border:1px solid #e7e7e7;
			text-align:center;
		}
		.btnBox{
			text-align:center;
			padding:15px 0;
		}
		.sure{
			background:#f9a61a;
		}
		textarea{
			font-family:"微软雅黑";
			border:none;
			width:99%;
			height:100%;
			outline:none;
		}
		.stairTicketLoss{
			display:flex;
		}

		.stairTicketLoss>div{
			width:393px;
		}
		.stairTicketLoss td[title]{
			background:#f1f1f1;
		}
		.stairTicketLoss td{
			border:1px solid #e7e7e7;
		}
		.stairTicketLoss .limit_1 td[title]{
			width:71px;
		}
		.stairTicketLoss .limit_1 td{
			height:44px;
			width:319px;
		}
		.stairTicketLoss .limit_2 td[title]{
			height:27px;
		}
		.stairTicketLoss .limit_2 td{
			height:34px;
			width:319px;
		}
		.backTicketCost>div{
			float:left;
			height:44px;
		}
		.stairTicketLoss .backTicketCost{
			text-align:center;
			line-height:44px;
		}
		.backTicketCost>div:nth-of-type(1){
			width:115px;
		}
		.backTicketCost>div:nth-of-type(2){
			width:71px;
			background:#f1f1f1;
			border-left:1px solid #e7e7e7;
			border-right:1px solid #e7e7e7;
		}
		.backTicketCost>div:nth-of-type(3){
			width:117px;
		}
	</style>
	<body>
		<p class='title'>
			<span><i class='quare'></i>适用日期</span>
		</p>
		<table class='tableSame'>
			<tr>
				<td class='tdColor'>方案编号</td>
				<td id="number"></td>
				<td class='tdColor'>方案类型</td>
				<td id="type"></td>
				<td class='tdColor'>适用舱位</td>
				<td id="cabin"></td>
				<td class='tdColor'>状态</td>
				<td id="status"></td>
			</tr>
			<tr>
				<td class='tdColor'>创建人</td>
				<td id="creator"></td>
				<td class='tdColor'>开始日期</td>
				<td id="startDate"></td>
				<td class='tdColor'>结束日期</td>
				<td id="endDate"></td>
				<td class='tdColor'>货币类型</td>
				<td id="currency"></td>
			</tr>
		</table>
		<div class="stairTicketLoss">
			<div>
				<p class='title'>
					<span><i class='quare'></i>限制条件</span>
				</p>
				<table class="limit_1">
					<tr>
						<td title>座位数</td>
						<td class="seatCount"></td>
					</tr>
					<tr>
						<td title>退票费</td>
						<td class="backTicketCost"><div class="refundFee"></div><div>改期费</div><div class="revaFee"></div></td>
					</tr>
					<tr>
						<td title>其他备注</td>
						<td class="remark"></td>
					</tr>					
				</table>
			</div>
			<div>
				<p class='title'>
					<span><i class='quare'></i>票损规则</span>
				</p>
				<table class="limit_2">
					<tr>
						<td title>出票率%</td>
						<td title>票损</td>
					</tr>
					<tr>
						<td class="ticketRate1"></td>
						<td class="ticketLossRate1"></td>
					</tr>
					<tr>
						<td class="ticketRate2"></td>
						<td class="ticketLossRate2"></td>
					</tr>
					<tr>
						<td class="ticketRate3"></td>
						<td class="ticketLossRate3"></td>
					</tr>
				</table>
			</div>
		</div>
		<div id="SANKELimit">
			<p class='title'>
				<span><i class='quare'></i>限制条件</span>
				<table class="tableSame">
					<tr>
						<td class='tdColor'>退票费</td>
						<td class="refundFee_"></td>
						<td class='tdColor'>改期费</td>
						<td class="revaFee_"></td>
						<td class='tdColor'>其他备注</td>
						<td class="remark_" style="width:37.5%"></td>
					</tr>
				</table>
			</p>
		</div>
		<p class='title'>
			<span><i class='quare'></i>价格体系</span>
		</p>
		<table class='tableDiff'>
			<tr style='background:#f1f1f1;'>
				<td>旅客/舱位</td>
				<td>价格调整</td>
				<td>税金</td>
			</tr>
			<tr>
				<td>成人</td>
				<td id="adultAdjustment"></td>
				<td id="adultTFC"></td>
			</tr>
			<tr>
				<td>儿童(2-12)</td>
				<td id="childAdjustment"></td>
				<td id="childTFC"></td>
			</tr>
			<tr>
				<td>婴儿(0-2)</td>
				<td id="infantAdjustment"></td>
				<td id="infantTFC"></td>
			</tr>
		</table>
		<!-- <div class='btnBox'>
			
			<button class='Dolo_btn sure'>确认</button>
		</div> -->
	</body>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>
		<script type="text/javascript" src="../layer-v2.4/layer/layer.js" ></script>
			<!-- 引入my97日期时间控件 -->
		<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js" charset="utf-8"></script>	
		<script type="text/javascript" src="../js/common.js" ></script>
		<script>
		 var url = document.location.href.toString();
		 var u = url.split("=");
		 //alert(u[1]) 获取通过URL向下一个页面传过来的id值
		 $.ajax({
				type:"get",
				url:"../fareplan/fareplan?id="+u[1]+"&temp="+Math.random(),
				dataType:"json",
				async:true,
				success:function(data){
					//console.log(data);
					$("#number").text(data.data.number);//方案编号
					$("#type").text(commomFun.typeStatusStr(data.data.type));//方案类型
					$("#cabin").text(commomFun.cabinStatusStr(data.data.cabin));//适用舱位
					$("#status").text(commomFun.priceStatusStr(data.data.status));//状态
					$("#creator").text(data.data.creator);//创建人
					$("#startDate").text(data.data.startDate);//开始日期
					$("#endDate").text(data.data.endDate);//结束日期
					$("#currency").text(commomFun.currencyMStr(data.data.currency))//货币类型
					
					$(".seatCount").text(commomFun.toEmptyString(data.data.seatMin)+"—"+commomFun.toEmptyString(data.data.seatMax));//座位数
					$(".refundFee").text(data.data.refundFee);//退票费
					$(".revaFee").text(data.data.revaFee);//改期费
					$(".remark").text(data.data.remark);//其它备注 
					//阶梯票损
					(function(){
						var ticketRate = data.data.ticketRate;
						var ticketLoss = data.data.ticketLoss;
						var ticketLossRate = data.data.ticketLossRate;
						if(ticketRate==ticketLossRate&&ticketLossRate==100){
							$(".ticketRate1").text("0 — 100");
							$(".ticketLossRate1").text("全损");
							$(".ticketRate2").text("—");
							$(".ticketLossRate2").text("—");
							$(".ticketRate3").text("—");
							$(".ticketLossRate3").text("—");
						}
						if(ticketRate==ticketLossRate&&ticketLossRate!==100){
							$(".ticketRate1").text(commomFun.toEmptyString(ticketRate)+" — 100");
							$(".ticketLossRate1").text("0");
							$(".ticketRate2").text("0 — "+commomFun.toEmptyString(ticketLossRate));
							$(".ticketLossRate2").text("全损");
							$(".ticketRate3").text("—");
							$(".ticketLossRate3").text("—");
						}
						if(ticketRate!==ticketLossRate){
							$(".ticketRate1").text(commomFun.toEmptyString(ticketRate)+" — 100");
							$(".ticketLossRate1").text("0");
							$(".ticketRate2").text(commomFun.toEmptyString(ticketLossRate)+" — "+commomFun.toEmptyString(ticketRate));
							$(".ticketLossRate2").text(commomFun.toEmptyString(ticketLoss));
							$(".ticketRate3").text("0 — "+commomFun.toEmptyString(ticketLossRate));
							$(".ticketLossRate3").text("全损");
						}
					})()
					
					$("#adultAdjustment").text(data.data.adultAdjustment);//成人价格调整
					$("#adultTFC").text(data.data.adultTFC);//成人税金
					$("#childAdjustment").text(data.data.childAdjustment);//儿童价格调整
					$("#childTFC").text(data.data.childTFC);//儿童税金
					$("#infantAdjustment").text(data.data.infantAdjustment);//婴儿价格调整
					$("#infantTFC").text(data.data.infantTFC);//婴儿税金
					
					(function(){
						console.log(data.data.type)
						if(data.data.type=="SK"){
							$(".stairTicketLoss").hide();
							$(".refundFee_").text(data.data.refundFee);
							$(".revaFee_").text(data.data.revaFee);
							$(".remark_").text(data.data.remark);
						}
						if(data.data.type=="QW"){
							$("#SANKELimit").hide();
						}
					})()
				}
			});
		
		
		
		</script>		
</html>
